Whenever the slice of a domU is set to 0, sedf_adjdom() sets extraweight
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 23 Feb 2006 10:31:01 +0000 (11:31 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 23 Feb 2006 10:31:01 +0000 (11:31 +0100)
commit224d655aba8423f8ca61cc397bf1ea647004e4c6
tree99e16f6af19c1edc131699119b1e0f792a045f8d
parent2b3ef497e8ad3e7ac13bd3bce25bb4bd40f92837
Whenever the slice of a domU is set to 0, sedf_adjdom() sets extraweight
to 0.  Later, in desched_extra_dom(), if the extrawight is not set, the
vcpu's score is calculated with this:

 /*domain was running in L1 extraq => score is inverse of
   utilization and is used somewhat incremental!*/
   if ( !inf->extraweight )
       /*NB: use fixed point arithmetic with 10 bits*/
       inf->score[EXTRA_UTIL_Q] = (inf->period << 10) /
           inf->slice;

Which can result in a divide by zero.

This changeset adds a comments and additional sanity check to prevent this
case from crashing Xen.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
xen/common/sched_sedf.c